package model;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* @author 听风寂
* @date 2020/1/6
* @ClassName Passage
* @Description 类描述
*/
public class Passage {
	private int id;
	private String author =null;
	private String title = null;
	private String body = null;
	private Date writeDate =null;
	private long hitCount =0;
	String writeDateString = null;
	private DateFormat format = new SimpleDateFormat("yyyy-MM-dd kk:hh:ss");
	
	public Passage(String title, String body) {
		super();
		this.title = title;
		this.body = body;
	}

	public Passage(String author,String title, String body,Date writeDate,long hitCount) {
		super();
		this.author=author;
		this.title = title;
		this.body = body;
		this.writeDate = writeDate;
		this.writeDateString=format.format(writeDate);
		this.hitCount=hitCount;
	}
	
	public Passage(int id,String author,String title, String body,Date writeDate,long hitCount) {
		super();
		this.id=id;
		this.author=author;
		this.title = title;
		this.body = body;
		this.writeDate = writeDate;
		this.writeDateString=format.format(writeDate);
		this.hitCount=hitCount;
	}
	

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getBody() {
		return body;
	}

	public void setBody(String body) {
		this.body = body;
	}

	public Date getWriteDate() {
		return writeDate;
	}

	public void setWriteDate(Date writeDate) {
		this.writeDate = writeDate;
	}

	public long getHitCount() {
		return hitCount;
	}

	public void setHitCount(long hitCount) {
		this.hitCount = hitCount;
	}

	public String getWriteDateString() {
		return writeDateString;
	}

	public void setWriteDateString(String writeDateString) {
		this.writeDateString = writeDateString;
	}

	@Override
	public String toString() {
		return "[author=" + author + ", title=" + title + ", body=" + body + ", writeDate=" + writeDateString +", hitCount="+hitCount+ "]\n";
	}
	
	
}
